package br.edu.fanor.esfinge.dao.impl;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import br.edu.fanor.esfinge.dao.CheckInDAO;
import br.edu.fanor.esfinge.entity.CheckIn;

@Stateless(mappedName="ejb/CheckInDAO")
public class CheckInDAOImpl implements CheckInDAO{

	@PersistenceContext
	public EntityManager emr;
	
	@Override
	public CheckIn inserir(CheckIn checkin) {
		emr.persist(checkin);
		return checkin;
	}

	@Override
	public CheckIn buscarId(long id) {
		return emr.find(CheckIn.class, id);
	}

	@Override
	public void remover(CheckIn checkin) {
		emr.remove(checkin);
		
	}

}
